Method and system for editing a table in a document

ABSTRACT

A method and system for inserting a table over text, for splitting a cell with text into two or more cells, for converting a bordered paragraph into a table, and for adding cells to a table. A table drawing tool allows a user to insert a table over existing text in a document, convert a bordered paragraph into a table, split a table cell into multiple cells, and add cells to a table, among other features. To insert a table over existing text, a subset of the plurality of lines of text that the table covers is determined. A determination is made whether the subset of text needs to be placed inside the table. If so, then the subset of text is extracted from the electronic file and the subset is placed inside a paragraph. The table is inserted into the electronic file with a height equal to the height of the extracted subset of text and the paragraph is pasted into the table. If it is determined that the subset of text does not need to be placed inside the table, then the table is added to the electronic file as a paragraph, without any text in the paragraph.

TECHNICAL FIELD

This invention relates to editing a table in an electronic document.More particularly, this invention relates to inserting a table overtext, for converting a bordered paragraph into a table, for splittingtable cells with text, and for adding cells to a table.

BACKGROUND OF THE INVENTION

Use of word processing program modules has increased in recent years duein part to the flexibility and simplicity of these programs. Oftentimes,documents with tables are produced using these word processing programmodules.

Unfortunately, documents with tables are not as easy to produce asdocuments of entire text. Thus, word processing program developers havetried to develop easier, simpler, and more user-friendly mechanisms forproducing and editing tables in an electronic document in order toprovide a more competitive word processing program.

In order to better understand how tables are produced and stored in anelectronic document, it is helpful to review how elements of a document,in general, are produced and stored. Some word processing programmodules store elements of an electronic document on a character basis.For these character word processing program modules, new table-formingcharacters may be added as characters to the word processing programmodule so that tables may be inserted into a document. For example,referring to FIG. 1, several different table-forming characters 10 areillustrated: a horizontal line 15, a vertical line 20, corner characters25, 30, 35, 40, four-way junction 45, and t-junctions 50, 55. Usingthese table-forming characters 10, a user may construct a table ofvirtually any size and shape using either a keyboard or a mouse to addthe table-forming characters to a document.

In early versions of program modules with table-forming characters, theaddition of textual characters to a table might destroy the shape of thetable since any added characters could push or move the table-formingcharacters and, thus, destroy the shape of the table. In laterimprovements, program modules were provided with some intelligence todetermine whether the characters on a line constitute a table and, ifso, to make certain adjustments. For example, the program may make anadjustment to switch to an overtype mode or to wrap text to the nextline. Although table-forming characters provide an adequate solution fortables in word processing program modules that store elements on acharacter basis, some word processing program modules do not storeelements of a document on a character basis. Thus, a different solutionis needed to provide easy-to-use tables for these program modules.

Some word processing program modules store text as a stream ofcharacters with paragraph marks. The paragraph marks hold formattinginformation for the stream of characters. Typically, in thesestream-based program modules, cells in a table are composed of a seriesof paragraphs with special table formatting. The special tableformatting may describe attributes of the cell such as the type ofborder of the cell, the row that the cell is in, the height of the row,whether text is displayed at the top, the middle, or the bottom of thecell, justification of text in the cell, and other attributes. Thus,although the table appears on screen as a single object, it may bestored as a series of paragraphs.

Some word processing program modules also include master cells and slavecells for tables. Typically, master cells control the formatting ofslave cells. Slave cells are suppressed, i.e., their borders, contents,etc., are controlled by the master cell. Referring now to FIG. 2, atable 200 is illustrated including master cells and slave cells. In FIG.2, the dashed lines represent lines that define cell borders, but whichare not displayed on-screen. It should be understood that a row in atable typically must be the same height across the entire row. Thus,there is a need for master cells and slave cells. Cell 205 appears tothe user as one large cell when it is actually composed of four cells: amaster cell 210 and slave cells 215. It should also be understood thatcell 217 is composed of master cell 220 and slave cells 225. Generally,all slaves cells must be calculated before the complete cells 205, 217can be drawn because the complete cell boundaries are not known untilall the slave cells have been calculated.

In some stream-based word processing program modules, a table drawingtool for drawing tables is available. Generally, a table drawing toolallows a user to insert a one-cell table by clicking down a mouse buttonat a point in a document. The user holds down the mouse button and dragsthe mouse to increase or decrease the size of the table. When the userreleases the mouse button, the table is inserted into the document atthe insertion point. Prior to the availability of a table drawing tool,a table was inserted into a document by selecting an insert tablecommand from a menu.

Although using the prior art table drawing tools are more convenientthan selecting an insert table command from a menu, there are problemswith these prior art table drawing tools. In the prior art, thesituation in which a table is drawn on top of existing text is nothandled the way users expect. A user draws a table over text, expectingit to become a table around existing text, but instead the text ispushed up or down in the document and the table is inserted with no textinside. For example, referring now to FIG. 3A, a prior art table drawingtool 300 is illustrated. As shown in FIG. 3A, a table drawing tool 300is typically displayed on a viewing screen or display as a pen, orstylus. The dashed line in FIG. 3A represents a new table 305 to beinserted into a document 310. The document 310 includes a first sentence315, a second sentence 320 and a third sentence 325. The new table 305begins at insertion point 330 when the user clicks a mouse button toinsert the new table 305. The new table 305 ends at end point 335 afterthe user drags the mouse to end point 335 and releases the mouse button.It should be understood that the new table is typically represented by adashed line until the user releases the mouse button. Thus, as shown inFIG. 3A, the new table 305 has not yet been inserted into the documentand the user has not yet released the mouse button.

Still referring to FIG. 3A, it will be seen that new table 305completely covers the second sentence 320 and the third sentence 325. Auser generally expects the second sentence 320 and the third sentence325 to be inside the new table 305 after the mouse button is released.However, as shown in FIG. 3B, that is not the case with the prior arttable drawing tools.

Referring now to FIG. 3B, the new table 305 of document 310 isillustrated. The new table 305 is a solid line in FIG. 3B demonstratingthat the mouse button has been released and new table 305 has beeninserted into the document 310. New table 305 has been inserted into thedocument at the insertion point 330, but the second sentence 320 and thethird sentence 325 are no longer inside the table 305. Thus, there is aneed for inserting a table into a document such that a table may beinserted over existing text with the existing text placed inside thetable.

Another problem of the prior art table drawing tools is that when a userattempts to split a table cell with text into two table cells, one cellis typically expanded to include all the text, when the user actuallywanted to split the text between the two cells. For example, users mightput spaces or tabs to separate text and may believe they could split thetext into two cells at the point of the spaces or tabs. This does notwork with the prior art table tools because of the stream-basedstructure of word processing program modules.

Referring now to FIG. 4A, a table drawing tool 405 in a document 410 hasbeen dragged vertically downward from insertion point 415 to an endpoint 420 to form a cell border 422. As illustrated in FIG. 4A, the cellborder 422 has not been placed inside the document 410 yet, as indicatedby the dashed line. First sentence 425, second sentence 430 and thirdsentence 435 are inside an existing table 440. Generally, when the userreleases the mouse button to insert the cell border 422 into thedocument, the user expects that the sentences 425, 430 and 435 will besplit at the cell border 422. As illustrated in FIG. 4B, this is not theresult with the prior art table drawing tool.

Referring now to FIG. 4B, the table 440 of document 410 has been splitinto two cells 445, 450. However, the cell 445 has been expandedvertically to accommodate the sentences 425, 430, and 435. No text isdisplayed in a cell 450. This is a result that the user typically doesnot expect. Thus, there is a need for splitting a cell in a table suchthat the text inside the cell is split between the two cells.

Another problem with prior art table drawing tools is the inability toadd cells to the sides, top, or bottom of a table. Thus, there is a needfor adding cells to the sides, top, or bottom of a table.

In summary, there is a need in the art for a method and system forinserting a table into a document such that a table may be inserted overexisting text with the existing text placed inside the table. There is afurther need in the art for a method and system for splitting a cell ina table such that the text inside the table is split between the tworesulting cells. There is still a further need for a method and systemfor adding cells to the sides, top, or bottom of a table using a tabledrawing tool.

SUMMARY OF THE INVENTION

Generally described, the present invention provides acomputer-implemented method for inserting a table over text, forsplitting a cell with text into two or more cells, for converting abordered paragraph into a table, and for adding cells to a table.

In one aspect, the present invention is a computer-implemented methodfor inserting a table over existing text. A subset of the plurality oflines of text that the table covers is determined. A determination ismade whether the subset of text needs to be placed inside the table. Ifso, then the subset of text is extracted from the electronic file andthe subset is placed inside a paragraph. The table is inserted into theelectronic file with a height equal to the height of the extractedsubset of text and the paragraph is pasted into the table. If it isdetermined that the subset of text does not need to be placed inside thetable, then the table is added to the electronic file as a paragraph,without any text in the paragraph.

In one aspect, the present invention is a computer-implemented methodfor converting a bordered paragraph into a first table. A determinationis made whether a second table is greater than 20 pixels long in heightand, if so, a determination is made whether the second table is lessthan five pixels in width. If the second table is less than five pixelsin width, then an examination is made of the lines of text that areintersected by the second table to determine whether the intersectedlines share a paragraph border. If the intersected lines share aparagraph border, then the intersected lines are extracted from thedocument. The first table is placed into the document and theintersected lines of text are placed inside the first table.

In another aspect, the present invention is a method for adding a cellto the top or bottom of an existing table. A determination is madewhether the cell is within 5 pixels of a top or a bottom of the existingtable. If so, then a determination is made that the cell is a new cellin the existing table and the new cell is added to the top or the bottomof the existing table.

In yet another aspect, the present invention is a method for adding acell to the side of an existing table. A determination is made whetherthe cell is within five pixels of the existing table. If so, then thecell is added as a new cell in the existing table. The top of the newcell is aligned to a first row of the existing table and the bottom ofthe new cell is aligned to a second row of the existing table.

These and other features, advantages, and aspects of the presentinvention may be more clearly understood and appreciated from a reviewof the following detailed description of the disclosed embodiments andby reference to the appended drawings and claims.

BRIEF DESCRIPTION OF THE DRAWINGS

FIG. 1 is an illustration of several different table-forming characters.

FIG. 2 is an illustration of a table including master cells and slavecells.

FIGS. 3A-3B are illustrations of inserting a new table into a documentusing a prior art table drawing tool.

FIGS. 4A-4B are illustrations of splitting an existing table using aprior art table drawing tool.

FIG. 5 is a block diagram of a computer that provides the exemplaryoperating environment for the present invention.

FIG. 6 is a flow chart illustrating a method for inserting a table overexisting text.

FIG. 7 is a flow chart illustrating another embodiment of a method forinserting a table over existing text.

FIGS. 8A, 8B, 9A, 9B, 10A and 10B are illustrations of inserting a tableover text.

FIG. 11 is a flowchart illustrating a method for converting a borderedparagraph into a table.

FIGS. 12A and 12B are illustrations of converting a bordered paragraphinto a table.

FIG. 13 is a flowchart illustrating a method for inserting a tablesurrounding one or more paragraphs with paragraph borders.

FIGS. 14A and 14B are illustrations of inserting a table surrounding oneor more paragraphs with paragraph borders.

FIG. 15 is a flowchart illustrating a method for adding a cell to thetop or bottom of an existing table.

FIGS. 16A and 16B are illustrations of adding a cell to the top of anexisting table.

FIG. 17 is a flowchart illustrating a method for adding cells to thesides of an existing table.

FIGS. 18A and 18B are illustrations of adding a cell to the side of anexisting table.

FIG. 19 is a flowchart illustrating a method for splitting cells in atable with a horizontal line when the cells include text.

FIGS. 20A and 20B are illustrations of splitting cells in a table with ahorizontal line when the cells include text.

FIG. 21 is a flowchart illustrating a method for splitting cells in atable with a vertical line when the cells include text.

FIGS. 22A and 22B are illustrations of splitting cells in a table with avertical line when the cells include text.

DETAILED DESCRIPTION

The present invention is directed toward inserting a table over text,for splitting a cell with text into two or more cells, for converting abordered paragraph into a table, and for adding cells to a table. In oneembodiment, the invention is incorporated into a preferred wordprocessing application program entitled "WORD 97 FE (Far East version)",marketed by Microsoft Corporation of Redmond, Washington. Brieflydescribed, the preferred application program allows a user to create andedit electronic documents by entering characters, symbols, graphicalobjects, and commands. "WORD 97 FE (Far East version)" stores electronicdocuments as a stream of characters with paragraph marks. The paragraphmarks hold formatting information for the stream of characters.Typically, cells in a table are composed of a series of paragraphs withspecial table formatting. The special table formatting may describeattributes of the cell such as the type of border of the cell, the rowthat the cell is in, the height of the row, whether text is displayed atthe top, the middle, or the bottom of the cell, justification of text inthe cell, and other attributes.

The preferred application program also allows a user to create and edittables using a table drawing tool. Generally described, a table drawingtool in accordance with an embodiment of the present invention isincorporated into the preferred application program module and allows auser to insert a table over text, convert a bordered paragraph into atable, split a table cell into multiple cells, and add cells to a table,among other features.

Having briefly described an exemplary embodiment of the presentinvention, an exemplary operating environment for the present inventionis described below.

Exemplary Operating Environment

Referring now to the drawings, in which like numerals represent likeelements throughout the several figures, aspects of the presentinvention and the exemplary operating environment will be described.

FIG. 5 and the following discussion are intended to provide a brief,general description of a suitable computing environment in which theinvention may be implemented. While the invention will be described inthe general context of an application program that runs on an operatingsystem in conjunction with a personal computer, those skilled in the artwill recognize that the invention also may be implemented in combinationwith other program modules. Generally, program modules include routines,programs, components, data structures, etc. that perform particulartasks or implement particular abstract data types. Moreover, thoseskilled in the art will appreciate that the invention may be practicedwith other computer system configurations, including hand-held devices,multiprocessor systems, microprocessor-based or programmable consumerelectronics, minicomputers, mainframe computers, and the like. Theinvention may also be practiced in distributed computing environmentswhere tasks are performed by remote processing devices that are linkedthrough a communications network. In a distributed computingenvironment, program modules may be located in both local and remotememory storage devices.

With reference to FIG. 5, an exemplary system for implementing theinvention includes a conventional personal computer 520, including aprocessing unit 521, a system memory 522, and a system bus 523 thatcouples the system memory to the processing unit 521. The system memory522 includes read only memory (ROM) 524 and random access memory (RAM)525. A basic input/output system 526 (BIOS), containing the basicroutines that help to transfer information between elements within thepersonal computer 520, such as during start-up, is stored in ROM 524.The personal computer 520 further includes a hard disk drive 527, amagnetic disk drive 528, e.g., to read from or write to a removable disk529, and an optical disk drive 530, e.g., for reading a CD-ROM disk 531or to read from or write to other optical media. The hard disk drive527, magnetic disk drive 528, and optical disk drive 530 are connectedto the system bus 523 by a hard disk drive interface 532, a magneticdisk drive interface 533, and an optical drive interface 534,respectively. The drives and their associated computer-readable mediaprovide nonvolatile storage for the personal computer 520. Although thedescription of computer-readable media above refers to a hard disk, aremovable magnetic disk and a CD-ROM disk, it should be appreciated bythose skilled in the art that other types of media which are readable bya computer, such as magnetic cassettes, flash memory cards, digitalvideo disks, Bernoulli cartridges, and the like, may also be used in theexemplary operating environment.

A number of program modules may be stored in the drives and RAM 525,including an operating system 535, one or more application programs 536,a word processor program module 537, program data 538, and other programmodules (not shown). The word processor program module 537 may alsoinclude a table drawing tool program module 537a for adding tables to anelectronic document and editing tables in an electronic document.

A user may enter commands and information into the personal computer 520through a keyboard 540 and pointing device, such as a mouse 542. Otherinput devices (not shown) may include a microphone, joystick, game pad,satellite dish, scanner, or the like. These and other input devices areoften connected to the processing unit 521 through a serial portinterface 546 that is coupled to the system bus, but may be connected byother interfaces, such as a game port or a universal serial bus (USB). Amonitor 547 or other type of display device is also connected to thesystem bus 523 via an interface, such as a video adapter 548. Inaddition to the monitor, personal computers typically include otherperipheral output devices (not shown), such as speakers or printers.

The personal computer 520 may operate in a networked environment usinglogical connections to one or more remote computers, such as a remotecomputer 549. The remote computer 549 may be a server, a router, a peerdevice or other common network node, and typically includes many or allof the elements described relative to the personal computer 520,although only a memory storage device 550 has been illustrated inFIG. 1. The logical connections depicted in FIG. 1 include a local areanetwork (LAN) 551 and a wide area network (WAN) 552. Such networkingenvironments are commonplace in offices, enterprise-wide computernetworks, intranets and the Internet.

When used in a LAN networking environment, the personal computer 520 isconnected to the LAN 551 through a network interface 553. When used in aWAN networking environment, the personal computer 520 typically includesa modem 554 or other means for establishing communications over the WAN552, such as the Internet. The modem 554, which may be internal orexternal, is connected to the system bus 523 via the serial portinterface 546. In a networked environment, program modules depictedrelative to the personal computer 520, or portions thereof, may bestored in the remote memory storage device. It will be appreciated thatthe network connections shown are exemplary and other means ofestablishing a communications link between the computers may be used.

Having described an exemplary operating environment for the presentinvention, embodiments of the present invention will be described below.Briefly described, the present invention provides a method and systemfor inserting a table over existing text, for converting a borderedparagraph into a table, for splitting a table cell into multiple cells,and for adding cells to a table.

Method for Inserting a Table Over Existing Text

The table tool program module 537a may include the capability ofinserting a table over existing text. As described above in theBackground, prior art table tools for stream-based program modules wereunable to add a table over existing text. FIG. 6 is a flow chartillustrating a method 600 for inserting a table over existing text inaccordance with an exemplary embodiment of the present invention. Thoseskilled in the art will appreciate that this exemplary embodiment is acomputer-implemented process that is carried out by the computer inresponse to input from the user and instructions provided by a programmodule.

Generally described, this method comprises determining over which textthe new table has been drawn and determining whether this text needs tobe placed in the table. If so, then this text is extracted and placedinto its own new paragraph. The text is deleted from the document and atable is inserted with a height equal to the height of the extractedtext. The new text paragraph is then pasted into the table. However, ifit is determined that the text which the table has been drawn over doesnot need to be placed in the table, then the table is added into thedocument as a paragraph with no text pasted into the table.

Referring now to FIG. 6, the method 600 for inserting a table overexisting text begins at start step 605 and proceeds to step 610 when auser, using the table drawing tool, draws a table over existing text ina document. Existing text refers to text that has already been placed inthe document, as opposed to text that is typed into a table after thetable has been drawn. At step 610, it is determined over which lines oftext the user is attempting to draw a table. It should be understoodthat the electronic document includes information regarding the locationof lines of text. Using this information along with informationregarding the drawn table, such as the insertion point of the drawntable, the word processing program module 537 is able to determine overwhich lines of text the user is attempting to draw a table. After it isdetermined over which lines of text the user is attempting to place atable, the method proceeds to decision step 615.

At decision step 615, it is determined whether the covered lines of textneed to be placed inside the drawn table. The covered lines of textrefers to the lines of text which the user is trying to draw over. Inone embodiment, the determination at decision step 615 is made basedupon whether the width of the drawn table covers the width of thecovered text. If, at decision step 615, it is determined that thecovered lines of text do not need to be placed inside the drawn table,then the method proceeds to step 620.

At step 620, the drawn table is added to the document at the point ofinsertion as a separate paragraph from the text. The point of insertionrefers to the point at which the user begins to draw the table. Thus,the drawn table does not include the covered text. The method then endsat step 699.

However, if, at decision step 615, it is determined that the coveredlines of text do need to be placed inside the drawn table, then themethod proceeds to step 625. At step 625, the lines of text over whichthe table is drawn are copied and placed into their own paragraph. Themethod then proceeds to step 630. The text over which the table is drawnis then deleted from the document at step 630 and the method proceeds tostep 635.

At step 635, the drawn table is inserted into the document. It should beunderstood that the drawn table typically has a height equal to theheight of the text that was extracted from the document at step 625.After the drawn table is inserted into the document at step 635, themethod proceeds to step 640.

At step 640, the new text paragraph that was created at step 625 ispasted into the new table. The method then ends at step 699. It shouldbe understood that the steps of method 600 are accomplished in thebackground such that the user does not see these steps. The user simplysees the end result on the monitor 547.

More specifically, in another embodiment, referring to FIG. 7, themethod 700 for inserting a table over existing text begins at start step705 and proceeds to step 710 when a user draws a table over existingtext in a document using the table drawing tool. At step 710, it isdetermined over which lines of text the user is attempting to insert atable. After it is determined over which lines of text the user isattempting to insert a table, the method proceeds to decision step 715.

At decision step 715, it is determined whether the drawn table coversthe complete width of at least one paragraph and more than one line oftext. If not, then the method proceeds to step 720. It should beunderstood that if the drawn table does not cover the complete width ofat least one paragraph and more than one line of text, then the user isprobably not trying to draw a table over existing text. At step 720, thedrawn table is added to the electronic document at the start of theparagraph containing the point of insertion as a separate paragraph fromthe text and no text is inserted into the table. The method then ends atstep 799.

However, if at decision step 715, it is determined that the drawn tablecovers the entire width of at least one paragraph and more than one lineof text, then the method proceeds to decision step 725. At decision step725, it is determined whether the drawn table extends across the entirewidth of a single paragraph, but does not cover all the lines of theparagraph. If so, then the method proceeds to step 730. However, if not,then the method proceeds to step 735.

At step 730, the paragraph which includes the covered text is split intoseparate paragraphs. The covered lines of text are placed into oneparagraph and the uncovered lines of text are placed into anotherparagraph. The paragraph including the covered text is placed into thedrawn table and the paragraph including the uncovered text is placedoutside the table. The method then ends at step 799.

At step 735, any complete paragraphs are placed into the drawn table andany partial paragraphs are split into separate paragraphs, as describedfor step 730 such that any covered text is placed into the drawn table.The method then ends at step 799.

To demonstrate method 700, examples are provided in reference to FIGS.8A, 8B, 9A, 9B, 10A, and 10B. Referring now to FIG. 8A, a document 805includes text with paragraph marks, such as a paragraph mark 830. Atable tool 810 is provided and a new table 825 has been drawn beginningat insertion point 815 and ending at an end point 820. As shown in FIG.8A, the table 825 is represented by dashed lines to show that it has notbeen inserted into the document yet because the user has not releasedthe mouse button.

Referring now to method 700, FIG. 7, and FIG. 8A, the method 700 forinserting a table over existing text begins at start step 705 andproceeds to step 710 when a user draws the table 825 over existing textin the document using the table drawing tool 820 and releases the mousebutton to insert the table 825 into the document 805. At step 710, it isdetermined over which lines of text the user is attempting to insert thetable 825. Referring to FIG. 8A, it is determined that the user isattempting to insert the table 825 over lines 835, 840, 845, and 850.Line 855 is not covered by the table 825. After it is determined overwhich lines of text the user is attempting to insert table 825, themethod proceeds to decision step 715.

At decision step 715, it is determined whether the table 825 covers thecomplete width of at least one paragraph and more than one line of text.Referring to FIG. 8A, the table 825 does not cover the complete width ofat least one paragraph and more than one line of text, so the user isprobably not trying to draw the table 825 over the existing text. Atstep 720, the drawn table 825 is added to the electronic document 805 atthe start of the paragraph containing the point of insertion 815 as aseparate paragraph from the text and no text is inserted into the table.The end result displayed to the user is illustrated in FIG. 8B.

Another example demonstrating method 700 is illustrated in reference toFIGS. 9A and 9B. Referring now to FIG. 9A, a document 905 includes textwith paragraph marks, such as a paragraph mark 930. A table tool 910 isprovided and a new table 925 has been drawn beginning at an insertionpoint 915 and ending at an end point 920. As shown in FIG. 9A, the table925 is represented by dashed lines to show that it has not been insertedinto the document yet because the user has not released the mousebutton. The document 905 also includes text lines 935, 940, 945, 950,and 955.

Referring now to FIGS. 7 and 9A, the method 700 for inserting a tableover existing text begins at start step 705 and proceeds to step 710when a user draws the table 925 and releases the mouse button to insertthat table into the document 905. At step 710, it is determined that theuser is attempting to insert a table over lines 935 and 940. After it isdetermined over which lines of text the user is attempting to insert atable, the method proceeds to decision step 715.

At decision step 715, it is determined whether the drawn table coversthe complete width of at least one paragraph and more than one line oftext. It is determined that the table 925 covers more than one line oftext (lines 935 and 940) and covers the complete width of paragraph 930.Thus, for this example, the method proceeds to decision step 725. Atdecision step 725, it is determined that the table 925 covers the entirewidth of the paragraph 930, but does not cover all the lines because theline 945 of the paragraph 930 is not covered. Thus, the method proceedsto step 730.

At step 730, the paragraph 930, which includes the covered text, issplit into separate paragraphs, 960 and 930, and the covered text isplaced into table 925. Thus, as illustrated in FIG. 9B, lines 935 and940 are placed into their own paragraph 960 and the line 945 is left asthe only remaining line of the paragraph 930. The end result is shown inFIG. 9B.

A third example demonstrating method 700 is illustrated in reference toFIGS. 10A and 10B. Referring now to FIG. 10A, a document 1005 includestext with paragraph marks, such as a paragraph mark 1030. A table tool1010 is provided and a new table 1025 has been drawn beginning at aninsertion point 1015 and ending at an end point 1020. As shown in FIG.10A, the table 1025 is represented by dashed lines to show that it hasnot been inserted into the document yet because the user has notreleased the mouse button. The document 1005 also includes text lines1035, 1040, 1045, 1050, and 1055.

Referring now to FIGS. 7 and 10A, the method 700 for inserting a tableover existing text begins at start step 705 and proceeds to step 710when a user draws the table 1025 over existing text in the document 1005using the table drawing tool 1010. At step 710, it is determined thatthe user is attempting to insert the table 1025 over lines 1035, 1040,1045, and 1050. The method then proceeds to decision step 715.

At decision step 715, it is determined that table 1025 covers thecomplete width of the paragraph 1030 and more than one line of text, sothe method proceeds to decision step 725. At decision step 725, it isdetermined that the table 1025 extends across the entire width of theparagraph 1030 and covers all the lines of the paragraph 1030, so themethod proceeds to step 735.

At step 735, the complete paragraph 1030 is placed into the drawn table1025. Also, the sentence 1050 is placed into its own paragraph 1060. Allthe covered text (lines 1035, 1040, 1045, and 1050) is placed into thedrawn table. The result illustrated in FIG. 10B is displayed to theuser.

Method for Converting a Bordered Paragraph Into a Table

Referring now to FIG. 11, the table tool also includes the capability toconvert a bordered paragraph into a table. Sometimes, using prior arttable tools, a user attempts to split a bordered paragraph using thetable tool. A border is a type of formatting that may be applied to aparagraph to provide a pattern around the paragraph. In many cases, aborder may appear to be a table to a user and, thus, the user may try toedit a bordered paragraph as if it were a table. However, in the priorart, the results were unsatisfactory because the bordered paragraph isnot a table even though it may appear to be a table to the user.Generally described, method 1100 converts a bordered paragraph into atable so that it may be split according to certain table-splitting rulesdescribed below.

Referring now to FIG. 11, the method 1100 for converting a borderedparagraph into a table begins at start step 1105 and proceeds to step1110 when the user attempts to draw a table within a bordered paragraph.At step 1110, it is determined whether the insertion point of the drawntable is within a bordered paragraph. If so, the method proceeds todecision step 1115. If not, then the method ends at step 1199.

At decision step 1115, it is determined whether the drawn table isgreater than 5 pixels in height. If not, then the method ends at step1199. If the drawn table is greater than 5 pixels in height, then themethod proceeds to decision step 1120. It should be understood thatheight typically refers to the total length of the drag, independent ofwhether the drag if top-to-bottom or left-to-right.

At decision step 1120, it is determined whether the drawn table is lessthan five pixels in width. If so, then the user is probably not drawinga separate table, but instead is probably trying to split the borderedparagraph and, thus, the method proceeds to decision step 1125. However,if it is determined that the drawn table is greater than five pixels inwidth, then the user is probably trying to draw a separate table apartfrom the bordered paragraph and, thus, the method ends at step 1199.

It should be understood that decision steps 1115 and 1120 are describedwith regard to a vertical table drag used to split a bordered paragraph.For a horizontal table drag used to split a table, similar steps areused although different dimensions are used. For example, for ahorizontal table drag used to split a table, then the width dimensionwould be used at decision step 1115 and the height dimension would beused at decision step 1120.

At decision step 1125, the lines of text intersected by the drawn tableare examined and it is determined whether the intersected lines of texthave a top or bottom paragraph border. If not, then the method ends atstep 1199. However, if the lines of text intersected by the drawn tabledo have a top or bottom paragraph border, then the method proceeds tostep 1130.

At step 1130, the intersected lines of text, including the paragraphborder, are extracted from the document and the method proceeds to step1135. A table with the same height and width of the extracted lines oftext is inserted into the document at step 1135 and the method proceedsto step 1140.

At step 1140, the style of the extracted paragraph border is applied tothe table border and the paragraph border is removed from the extractedtext. The method then proceeds to step 1145. The extracted text ispasted into the table at step 1145 according to the cell-splitting stepsdescribed below. The cell-splitting steps are described in respect toFIGS. 19, 20A, 20B, 21, 22A and 22B. The method then ends at step 1199.

To demonstrate method 1100, an example is provided in reference to FIGS.12A and 12B. Referring now to FIG. 12A, document 1200 includes textlines 1210, 1215, and 1220. A table tool 1225 is provided and new table1230 has been drawn beginning at insertion point 1235 by depressing themouse button and ending at end point 1240. As shown in FIG. 12A, table1230 is represented by dashed lines to show that it has not beeninserted into the document yet because the user has not released themouse button.

Referring now to method 1100 and FIGS. 11 and 12A, the method 1100 forconverting a bordered paragraph into a table begins at start step 1105and proceeds to step 1110 when the user attempts to draw table 1230within bordered paragraph 1205. At step 1110, it is determined that theinsertion point 1235 of the table 1230 is within a bordered paragraphbecause the insertion point is on the bordered paragraph 1205. Themethod proceeds to decision step 1115.

At decision step 1115, it is determined that drawn table 1230 is greaterthan 5 pixels in height. At decision step 1120, it is determined thatthe table 1230 is less than five pixels in width. At decision step 1125,the lines of text 1210, 1215, and 1220 intersected by drawn table 1230are examined and it is determined that the intersected lines of text(1210, 1215 and 1220) have a paragraph border (1205). At step 1130, theintersected lines of text, including the paragraph border, are extractedfrom the document and the method proceeds to step 1135. A table with thesame height and width of the extracted lines of text is inserted intothe document at step 1135 and the method proceeds to step 1140. At step1140, the style of the extracted paragraph border is applied to thetable border and the paragraph border is removed from the extractedtext. The method then proceeds to step 1145. The extracted text ispasted into the table at step 1145 according to the cell-splitting stepsdescribed below. The cell-splitting steps are described in respect toFIGS. 19, 20A, 20B, 21, 22A and 22B. The method then ends at step 1199.The result displayed to the user is illustrated in FIG. 12B. Theparagraph borders 1205 have been converted into a table 1245 with twocells 1250 and 1255.

Another situation concerning paragraph borders that sometimes occurs isthat a user attempts to draw a table surrounding one or more paragraphswith paragraph borders. The user views the paragraph borders as cells ina table and expects them to be incorporated into a table as cells. Withprior art table drawing tools, the results were unsatisfactory becausetypically the table was inserted at the insertion point and theparagraphs with paragraph borders were placed above or below the tableand were not incorporated into the table. However, in an embodiment ofthe present invention, if a user draws a table that surrounds one ormore paragraphs with paragraph borders using the table drawing tool inaccordance with the present invention, then the method 1300 illustratedin FIG. 13 is performed.

Referring now to FIG. 13, the method 1300 begins at start step 1305 andproceeds to step 1310 where the text inside the drawn table is cut fromthe document and the method proceeds to decision step 1315.

At decision step 1315, it is determined whether the cut text includeseither top or bottom paragraph borders. If not, then the method ends atstep 1399. However, if the cut text includes either top or bottomparagraph borders, then the method proceeds to step 1320. At step 1320,cell rows are created in the table where the paragraph borders existedin the cut text and the method proceeds to step 1325. It should beunderstood that at step 1320, a new table row is created at each pointwhere there was a top or bottom paragraph border. This step may also beunderstood as a drawn table being split into rows a number of timesequal to the number of top/bottom paragraph borders that the table wasdrawn over.

At step 1325, the new table is added to the document, including cellborders, and the lines of text preceding the first paragraph border areinserted as a paragraph into the first row of the new table, the linesof text from the first paragraph border to the second paragraph borderare inserted as a paragraph into the second row, the lines of text fromthe second paragraph border to the third paragraph border are insertedas a paragraph into the third row, etc. In other words, the lines oftext from the nth paragraph border to the (n+1)th paragraph border areinserted as a paragraph into the (n+1)th row of the new table. Themethod then ends at step 1399.

To demonstrate method 1300, an example is provided in reference to FIGS.14A and 14B. Referring now to FIG. 14A, document 1405 includes text,including lines of text 1430, 1435, 1440, 1445, 1450, 1455, 1460 withinparagraph border 1465. A table tool 1410 is provided and new table 1425has been drawn beginning at insertion point 1415 by depressing the mousebutton and dragging the mouse to end point 1420. As shown in FIG. 14A,table 1425 is represented by dashed lines to show that it has not beeninserted into the document because the user has not released the mousebutton.

Referring now to method 1300 and FIGS. 13 and 14A, the method 1300 forinserting a table over existing text begins at start step 1305 andproceeds to step 1310 where the text inside the drawn table (lines 1445,1450, 1430, 1435, 1440, 1455, and 1460) is cut from document 1405 andthe method proceeds to decision step 1315.

At decision step 1315, it is determined that the cut text includes a topparagraph border 1467 and a bottom paragraph border 1470 and the methodproceeds to step 1320. Referring now to FIG. 14B, at step 1320, cellborders 1475 and 1480 are created in document 1405 where the paragraphborders existed in the cut text and the method proceeds to step 1325.

At step 1325, the new table 1425 is added to document 1405, includingcell borders 1475 and 1480. The lines of text 1445 and 1450 precedingthe first paragraph border 1465 are inserted into the first row 1485 ofthe table, the lines of text 1430, 1435, 1440 from the first paragraphborder 1465 to the second paragraph border 1470 are placed in the secondrow 1490, the lines of text 1455, 1460 from the second paragraph border1470 to the bottom of the table 1425 are placed in the third row 1495.

Method for Adding Cells to a Table

The table tool also includes the capability to add cells to an existingtable in a document. Using prior art table tools, it was difficult toadd cells to a table. Typically, using prior art table tools, a newtable separated by a paragraph might be added to the document when theuser actually wanted to add a cell to an existing table.

Referring now to FIG. 15, a method 1500 for adding cells to the top orbottom of an existing table in accordance with an embodiment of thepresent invention is illustrated. The method 1500 begins at start step1505 and proceeds to decision step 1510 when a user attempts to add anew table to a document. It is determined whether the new table fallswithin 5 pixels of the top or bottom of an existing table at decisionstep 1510. If so, then the method proceeds to step 1520. However, if itis determined that the new table is not within 5 pixels of the top orbottom of an existing table, then the method proceeds to step 1515.

At step 1515, the new table is inserted into the document with anon-table paragraph between the new table and any existing table. Themethod then ends at step 1599.

At step 1520, it is determined that the new table is a new cell in theexisting table and, thus, is added as a new cell to the top or bottom ofthe existing table. The method then ends at step 1599.

It should be understood that a table is a collection of paragraphs withspecial formatting. To add a cell to a table, a new paragraph withformatting indicating it is part of a table, and having a height andwidth set according to the drawn table, is inserted into the document inthe position immediately following (preceding) the last (first) cell ofthe table. This new paragraph is automatically considered part of thetable by the word processing program module because there is nointervening "non-table" paragraph. In other words, all consecutive tableparagraphs are considered part of the same table.

To demonstrate method 1500, an example is provided in reference to FIGS.16A and 16B. Referring now to FIG. 16A, document 1605 is illustrated. Atable tool 1610 is provided and new table 1625 has been drawn beginningat insertion point 1615 and ending at end point 1620. As shown in FIG.16A, table 1625 is represented by dashed lines to show that it has notbeen inserted into the document because the user has not released themouse button.

Referring now to FIG. 15 and FIG. 16A, method 1500 begins at start step1505 and proceeds to decision step 1510 when a user attempts to add newtable 1625 to document 1605. It is determined whether table 1625 fallswithin 5 pixels of the top or bottom of existing table 1630 at decisionstep 1510. If so, then the method proceeds to step 1520. However, if itis determined that the new table is not within 5 pixels of the top orbottom of existing table 1630, then the method proceeds to step 1515.Referring to FIG. 16A, distance 1635 is less than 5 pixels so the methodproceeds to step 1520.

At step 1520, it is determined that table 1625 is a new cell in theexisting table and, thus, is added as a new cell to the top or bottom ofthe existing table. The method then ends at step 1599 with the resultillustrated in FIG. 16B displayed to the user.

Referring now to FIG. 17, a method 1700 for adding cells to the sides ofan existing table in accordance with an embodiment of the presentinvention is illustrated. At step 1705 the method 1700 begins andproceeds to decision step 1710 when a user attempts to add a new tableto a document. It is determined whether the new table falls within fivepixels of an existing table at decision step 1710. If not, then themethod proceeds to step 1715. If so, then the method proceeds to step1720.

It should be understood that in an alternative embodiment, the methodbegins by determining whether the starting point of the drag is withinthe vertical distance covered by the table, or within 5 pixels verticaldistance of the top or bottom of the table. For example, the new cellmay be drawn 100 pixels to the right of an existing table, but if thestart of the drag is at the same latitude as the table, then the newcell is considered to be part of the table and added as a cell.

At step 1715, the new table is inserted into the document with anon-table paragraph between the new table and any existing table withthe result that the drawn table appears entirely above or below theexisting table. The method then ends at step 1799.

At step 1720, it is determined that the new table is a new cell in theexisting table and, thus, is added as a new cell in the existing tableusing the height attributes of the cell to the left of the cell (if thecell is added to the right side of the existing table) or to the rightof the new cell (if the new cell is added to the left side of theexisting table). It should be noted that when adding a cell to the sideto an existing table that the top and bottom of the new cell snaps tothe height of the nearest row. The method then ends at step 1799.

To demonstrate method 1700, an example is provided in reference to FIGS.17 and 18A. Referring now to FIG. 18A, document 1805 is illustrated. Atable tool 1810 is provided and new table 1825 has been drawn beginningat insertion point 1815 and ending at end point 1820. As shown in FIG.18A, table 1825 is represented by dashed lines to show that it has notbeen inserted into the document because the user has not released themouse button.

Referring now to FIG. 17 and FIG. 18A, method 1700 begins and proceedsto decision step 1710 when a user attempts to add new table 1825 todocument 1805. It is determined whether the insertion point 1815 of thenew table falls within five pixels of the top or bottom of an existingtable 1830, or anywhere in the vertical axis of the existing tableirrespective of the horizontal distance between insertion point 1815 andthe edges of table 1830 at decision step 1710. If not, then the methodproceeds to step 1715. If so, then the method proceeds to step 1720.Referring to FIG. 18A, assume that insertion point 1815 is in the samevertical range covered by table 1830 or within five pixels of the top orbottom borders of table 1830.

At step 1720, it is determined that the new table 1825 is a new cell inthe existing table 1830 and, thus, is added as a new cell in theexisting table using the height attributes of the cell to the right ofthe new cell (because the new cell is added to the left side of theexisting table 1830). It should be noted that when adding a cell to theside to an existing table that the top and bottom of the new cell snapsto the height of the nearest row. For example, referring to FIG. 18B,the result displayed to the user is illustrated. Table 1830 includesmaster cell 1840 and slave cells 1845, 1850 and 1855. Master cells andslave cells are described above in the background. Referring to FIG.18A, it will be noted that the top of cell 1825 is slightly above theheight of the nearest row (the row with cell 1845) and that the bottomof cell 1825 is slightly above the height of the nearest row (the rowwith cell 1850). However, referring now to FIG. 18B, it will be notedthat when the cell 1825 is added to the table, the top and bottom ofcell 1825 has been aligned with the nearest row. The method then ends atstep 1799.

Method for Splitting Cells that Include Text

The table tool also includes a feature for splitting cells in a tablewhen the cells include text. If the split is attempted with a horizontalline, then the method 1900 for splitting cells with a horizontal linewhen the cells include text is performed as illustrated in FIG. 19.

Referring now to FIG. 19, at step 1905, the method 1900 begins andproceeds to step 1910 when a user attempts to split a cell(s), includingtext, with a horizontal line, or horizontal drag. The vertical positionof the horizontal drag is determined and the lines of text in the tablewhich are above and below the vertical position are determined at step1910. Typically, text lines that are partially below the verticalposition are determined to be above the vertical position. The methodthen proceeds to step 1915.

At step 1915, the text in the table is extracted and the method proceedsto step 1920. The table is split with a horizontal cell border into twocells at step 1920 and the method proceeds to step 1925. At step 1925,the lines of text that are above the vertical position are pasted intothe upper cell and the lines of text that are below the verticalposition are pasted into the lower cell. The method then ends at step1999.

To demonstrate method 1900, an example is provided in reference to FIGS.20A and 20B. Referring now to FIG. 20A, document 2005 includes textlines 2050, 2055, 2060 and 2065. A table tool 2010 is provided andhorizontal drag 2025 has been drawn beginning at insertion point 2015and ending at end point 2020. As shown in FIG. 20A, horizontal drag 2025is represented by dashed lines to show that it has not been insertedinto the document because the user has not released the mouse button.

Referring now to FIG. 19 and FIG. 20A, the method 1900 begins andproceeds to step 1910 when a user attempts to split a cell(s), i.e.,table 2030, with horizontal drag 2025. The vertical position of thehorizontal drag 2025 is determined and the lines of text in the tablewhich are above and below the vertical position are determined at step1910. Lines 2050, 2055 are determined to be above the vertical positionand lines 2060, 2065 are determined to be below the vertical position.The method then proceeds to step 1915.

At step 1915, text lines 2050, 2055, 2060, 2065 in the table 2030 areextracted and the method proceeds to step 1920. The table 2030 is splitwith a horizontal cell border 2070 into two cells 2075, 2080 at step1920 and the method proceeds to step 1925. At step 1925, the lines oftext 2050, 2055 above the vertical position are pasted into the uppercell 2075 and the lines of text 2060, 2065 that are below the verticalposition are pasted into the lower cell 2080. The method then ends atstep 1999.

If a split of a cell is attempted with a vertical line, then the method2100 for splitting a cell/table, including text, with a vertical line,or drag is performed as illustrated in FIG. 21. Referring now to FIG.21, at step 2105 the method 2100 begins and proceeds to decision step2110. At decision step 2110, it is determined whether each row in thecell/table has some sort of white space underneath the drawn line.Typically, white space includes tabs, an indent, or two or more spaces.If not, then the method proceeds to step 2115. If so, then the methodproceeds to step 2130.

At step 2115, the text in the cell/table is extracted and the methodproceeds to step 2120. At step 2120, the cell/table is split into twocells, i.e., a left cell and a right cell, with a vertical cell borderand the method proceeds to step 2125. The text is pasted into the leftcell at step 2125 and the method ends at step 2199.

At step 2130, the horizontal position of the vertical drag is determinedand it is determined which text is left of the horizontal position andwhich text is right of the horizontal position. At step 2135, the textin the table is extracted and the method proceeds to step 2140.

At step 2140, the table is split into two cells (a left cell and a rightcell) by a vertical cell border and the method proceeds to step 2145. Atstep 2145, for each line that has a tab in it that positions part of thetext to the right of the vertical drag, then all text that was left ofthe split is pasted into the left cell and any text to the right of thesplit is pasted into the right cell. It should be noted that the tabstop is repositioned to keep the text in the same position relative toits original location or removed if the text abuts the cell edge. Themethod then proceeds to step 2150.

At step 2150, for each line that has spaces in it that positions part ofthe text to the right of the split, then all text that was left of thesplit is pasted into the left cell, with trailing spaces removed, andany text to the right of the split is pasted into the right cell. Itshould be noted that leading spaces are removed and indents are appliedto the paragraphs in the right cell relative to the vertical line tomaintain position of the text in the same position relative to itsoriginal location. The method then proceeds to step 2155.

At step 2155 for each line that has indents in it that positions thetext to the right of the split, then the text is pasted into the rightcell and the indenting is adjusted relative to the vertical line tomaintain the position of the text in the same position relative to itsoriginal location and the indent formatting is removed from the leftcell. The method then ends at step 2199.

To demonstrate method 2100, an example is provided in reference to FIGS.22A and 22B. Referring now to FIG. 22A, document 2205 includes textlines 2250,2255, and 2260. A table tool 2210 is provided and verticaldrag 2225 has been drawn beginning at insertion point 2215 and ending atend point 2220. As shown in FIG. 22A, vertical drag 2225 is representedby dashed lines to show that it has not been inserted into the documentbecause the user has not released the mouse button.

Referring now to FIG. 21 and FIG. 22A, the method 2100 begins andproceeds to decision step 2110. At decision step 2110, it is determinedthat each row (text lines 2250, 2255, 2260) in table 2265 has some sortof white space beneath the drawn line, or vertical drag. For example,text line 2250 has a tab beneath vertical drag 2225, text line 2255 hastwo or more spaces beneath the vertical drag 2225, and text line 2260has an indentation beneath the vertical drag 2225. The method thenproceeds to step 2130.

At step 2130, the horizontal position of the vertical drag 2225 isdetermined and it is determined which text is left of the horizontalposition and which text is right of the horizontal position. At step2135, the text lines 2250, 2255, 2260 in the table 2265 is extracted andthe method proceeds to step 2140.

At step 2140, the table 2265 is split into two cells (a left cell 2270and a right cell 2275) by a vertical cell border 2225 and the methodproceeds to step 2145. At step 2145, for text line 2250 that has a tabin it that positions part of the text to the right of the vertical drag,then all text that was left of the split is pasted into the left cell2270 and any text to the right of the split is pasted into the rightcell 2275. It should be noted that the tab stop is repositioned to keepthe text in the same position relative to its original location orremoved if the text abuts the cell edge. The method then proceeds tostep 2150.

At step 2150, for text line 2255 that has spaces in it that positionspart of the text to the right of the split, then all text that was leftof the split is pasted into the left cell 2270, with trailing spacesremoved, and any text to the right of the split is pasted into the rightcell 2275. It should be noted that leading spaces are removed andindents are applied to the paragraphs in the right cell relative to thevertical line to maintain position of the text in the same positionrelative to its original location. The method then proceeds to step2155.

At step 2155 for text line 2260 that has indents in it that positionsthe text to the right of the split, then the text is pasted into theright cell 2275 and the indenting is adjusted relative to the verticalcell border 2225 to maintain the position of the text in the sameposition relative to its original location and the indent formatting isremoved from the left cell 2270. The method then ends at step 2199.

It should be understood that the text in a row is split if there is morethan one space in a row, or if there is a tab or indent. However, in analternative embodiment, the text in a cell may be split when there isonly one space in a row.

From the foregoing description, it will be apparent to those skilled inthe art that the present invention provides a method and system forinserting a table over text, for splitting a cell with text into two ormore cells, for converting a bordered paragraph into a table, and foradding cells to a table.

Although the present invention has been described above as implementedin the preferred application program module, it will be understood thatalternative embodiments will become apparent to those skilled in the artto which the present invention pertains without departing from itsspirit and scope. Accordingly, the scope of the present invention isdefined by the appended claims rather than the foregoing description.

What is claimed is:
 1. For an electronic system for creating and editingan electronic file including a plurality of existing lines of text, amethod for inserting a table over the plurality of existing lines textin the electronic file, the method comprising the steps of:receiving auser command to draw the table over the plurality of lines of text usinga drawing tool; determining a subset of the plurality of lines of textthat the table covers; determining whether the width of the table coversthe width of the subset of the plurality of lines; if the determinationis made that the width of the table covers the width of the subset oftext, performing the steps of;extracting the subset of text from theelectronic file and placing the subset into a paragraph; deleting theextracted subset of text from the electronic file; inserting the tableinto the electronic file with a height equal to a height of theextracted subset of text; and pasting the paragraph into the table; ifthe determination is made that the width of the table does not cover thewidth of the subset of text, inserting the table to the electronic fileas a paragraph that does not include the plurality of lines of text. 2.For an electronic system for creating and editing an electronic fileincluding a plurality of lines of text, a method for converting aparagraph contained within a paragraph border, the paragraph borderhaving an associated style, into a table, the method comprising thesteps of:receiving a user command to draw the table over the pluralityof lines of text in the bordered paragraph; determining whether thetable is greater than a predetermined number of pixels in height;inresponse to determining that the table is greater than the predeterminednumber of pixels in height, determining whether the table is less than apredetermined number of pixels in width; in response to determining thatthe table is less than a predetermined number of pixels in width,determining whether at least one line of the text covered by the tableshares a paragraph border;extracting the subset of text, including theparagraph border, from the electronic file; inserting the table into thebordered paragraph in the electronic file, wherein the table has thesame height and width as the extracted subset of text; applying thestyle associated with the extracted border to a style associated withthe table; and pasting the subset of text inside the table.
 3. Themethod recited in claim 2 further comprising the step of determiningwhether an insertion point of the table is within the borderedparagraph, before the step of determining whether the table is greaterthan the predetermined number of pixels in height.
 4. The method recitedin claim 3 wherein the first table has the same height and width as thesubset of text.
 5. For an electronic system for creating and editing anelectronic file including a plurality of paragraphs, wherein at leastone paragraph is contained within a paragraph border, the paragraphborder having an associated style, into a table, the method comprisingthe steps of:receiving a user command to draw the table over a subset ofthe plurality of paragraphs using a table drawing tool; extracting fromthe electronic file the subset of paragraphs inside a table boundaryformed by the table drawing tool; determining whether the subset ofparagraphs includes either a top or a bottom paragraph border; if thedetermination is made that the subset of paragraphs includes either atop or bottom paragraph border, performing a sequence comprising thesteps of;adding the table to the electronic file, wherein the table hasa height equal to a height of the extracted subset of paragraphs,creating a cell border having an associated style in the table at thelocation of the top paragraph border and bottom paragraph border,wherein the style associated with the cell border is the same styleassociated with the paragraph border inserting a subset of the pluralityof lines of text preceding the top paragraph border into a first row ofthe table, inserting a subset of the plurality of lines of text betweenthe top paragraph border and the bottom paragraph border into a secondrow of the table, and inserting a subset of the plurality of lines oftext following the bottom paragraph border into a third row of thetable, and if the determination is made that the subset of paragraphs donot include either a top or bottom paragraph border, not converting theparagraph into a table.
 6. The method of claim 1, wherein the step ofdetermining whether the width of the table covers the width of thesubset of lines of text, comprises the steps of:determining whether thewidth of the table covers the width of at least one paragraph containingthe subset of lines of text; if the determination is made that the widthof the table covers the width of at least one paragraph, determiningwhether the table covers all the lines of the subset of text in theparagraph;if the determination is made that the table does not cover allthe lines of the subset of text in the paragraph, performing thesequence of; splitting the paragraph covered by the table into a firstparagraph and second a paragraph, extracting the subset of text coveredby the table and placing the subset of text into the first paragraph,extracting the text not covered the table and placing the text into thesecond paragraph, deleting the paragraph from the electronic file,inserting the table into the electronic file and pasting the firstparagraph into the table, and pasting the second paragraph into theelectronic file outside the table.